load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "handle",
    srcs = ["handle.go"],
    importpath = "github.com/pingcap/tidb/pkg/disttask/framework/handle",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/disttask/framework/proto",
        "//pkg/disttask/framework/storage",
        "//pkg/metrics",
        "//pkg/util/backoff",
        "//pkg/util/logutil",
        "@com_github_pingcap_errors//:errors",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "handle_test",
    timeout = "short",
    srcs = ["handle_test.go"],
    flaky = True,
    deps = [
        ":handle",
        "//pkg/disttask/framework/proto",
        "//pkg/disttask/framework/storage",
        "//pkg/testkit",
        "//pkg/testkit/testfailpoint",
        "//pkg/util/backoff",
        "@com_github_ngaut_pools//:pools",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_log//:log",
        "@com_github_stretchr_testify//require",
        "@com_github_tikv_client_go_v2//util",
    ],
)
